﻿<UserControl x:Class="mpost.SilverlightSingleFileUpload.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:mpost.SilverlightSingleFileUpload;assembly=mpost.SilverlightSingleFileUpload"
    xmlns:utils="clr-namespace:mpost.SilverlightMultiFileUpload.Utils.Helpers;assembly=mpost.SilverlightMultiFileUpload.Utils"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"  
    Background="White" x:Name="MainPageUC">
    <UserControl.Resources>
        <utils:ByteConverter x:Key="ByteConverter"/>

        <Storyboard x:Name="sbProgress">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="TotalProgress" Storyboard.TargetProperty="(RangeBase.Value)">
                <SplineDoubleKeyFrame x:Name="sbProgressFrame" KeyTime="00:00:00.5000000" Value="10"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Style="{StaticResource GridStyle}" AllowDrop="True" Drop="LayoutRoot_Drop">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />

        </Grid.RowDefinitions>

        <vsm:VisualStateManager.VisualStateGroups>
            <vsm:VisualStateGroup x:Name="UploadingStates">
                <vsm:VisualStateGroup.Transitions>
                    <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                </vsm:VisualStateGroup.Transitions>
                <vsm:VisualState x:Name="Empty">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="UploadButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Selected">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="UploadButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Finished">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="UploadButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
            </vsm:VisualStateGroup>
        </vsm:VisualStateManager.VisualStateGroups>

        <Grid Grid.Row="0" Width="Auto">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" HorizontalAlignment="Left" >
                <Button x:Name="SelectFilesButton" Content="{Binding Path=UserMessagesResource.SelectFiles, Source={StaticResource UserMessages}}" Click="SelectFilesButton_Click" Height="24" Padding="8,0,8,0"></Button>
                <Button x:Name="UploadButton" Content="{Binding Path=UserMessagesResource.Upload, Source={StaticResource UserMessages }}" FontWeight="Bold" Click="UploadButton_Click" Height="24" Padding="8,0,8,0"></Button>

            </StackPanel>

        </Grid>




        <StackPanel x:Name="FileList" Grid.Row="1" Height="30" Width="Auto" >
            <!--<ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <local:FileRowControl></local:FileRowControl>             
                    </DataTemplate>
                </ItemsControl.ItemTemplate>-->
        </StackPanel>
    </Grid>
</UserControl>
